package helpers;

import com.avaje.ebean.ExpressionList;

public class Query {
	
	public static <T> ExpressionList<T> addClientRequestExpression(ExpressionList<T> expression){
		
		ClientRequest clientRequest = ClientRequest.getCurrent();
		
		clientRequest.showDetail();
		
		if(clientRequest.appId > 0) expression.eq("app_id", clientRequest.appId);
    	if(clientRequest.marketKey > 0) expression.eq("market_key", clientRequest.marketKey);
    	if(clientRequest.deviceKey > 0) expression.eq("device_key", clientRequest.deviceKey);
    	
		return expression;
	}
}
